package com.cw.demo.service.impl;

import com.cw.demo.dao.SalarygradeDao;
import com.cw.demo.model.Salarygrade;
import com.cw.demo.service.SalarygradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import java.util.List;

@Component  //组件,默认情况下,这种注解方式,创建的实例化,他的id=salarygradeServiceImpl
public class SalarygradeServiceImpl implements SalarygradeService {
//    private DeptDao deptDao = new DeptDaoImpl();

    @Autowired //从spring的容器中,去查找类型为salarygradeDao的实例化对象
    @Qualifier("salarygradeDaoImpl")
    private SalarygradeDao salarygradeDao;

    @Autowired
    private Salarygrade salarygrade;
    public boolean saveSalarygrade(Salarygrade salarygrade) {
        return salarygradeDao.saveSalarygrade(salarygrade);
    }

    public boolean updateSalarygrade(Salarygrade salarygrade) {
        return salarygradeDao.updateSalarygrade(salarygrade);
    }

    public boolean deleteSalarygrade(int grade) {
        return salarygradeDao.deleteSalarygrade(grade);
    }

    public List<Salarygrade> findByParam(Salarygrade param) {
        System.out.println(salarygrade);
        return salarygradeDao.findByParam(param);
    }
/*
    public void setJobDao(JobDao jobDao) {
        this.jobDao = jobDao;
    }

    public JobDao getJobDao() {
        return jobDao;
    }*/
/*public SalarygradeServiceImpl(SalarygradeDao salarygradeDao){
    this.salarygradeDao = salarygradeDao;
}*/
}
